package com.jiulan.hearthearing.ui.heart.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jiulan.hearthearing.R;
import com.jiulan.hearthearing.ui.heart.model.ClassifyModel;

import java.util.List;

public class ClassifyFlowAdapter extends BaseQuickAdapter<ClassifyModel.DataBean.ChildBean, BaseViewHolder> {

    public ClassifyFlowAdapter(List<ClassifyModel.DataBean.ChildBean> data) {
        super(R.layout.item_classify_flow, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ClassifyModel.DataBean.ChildBean item) {
        helper.addOnClickListener(R.id.tvItem);
        TextView tvItem = helper.getView(R.id.tvItem);
        tvItem.setText(item.getCate_name());
        if (item.isCheck()){
            tvItem.setTextColor(mContext.getResources().getColor(R.color.title_bg));
        }else {
            tvItem.setTextColor(mContext.getResources().getColor(R.color.title_color));
        }
    }
}
